#include <math.h>
#include <string.h>
#include <stdio.h>
#include "compare.h"


int
float_compare (void *a, void *b)
{
        float *f1 = (float *)a;
        float *f2 = (float *)b;
 
        if (*f1 > *f2)
                return 1;
        else if (fabs (*f1 - *f2) <= 10E-6)
                return 0;
        else
                return -1;
}
 
int
str_compare (void *a, void *b)
{
        size_t len1 = strlen ((char *)a);
        size_t len2 = strlen ((char *)b);
 
        if (len1 > len2)
                return 1;
        else if (len1 == len2)
                return 0;
        else
                return -1;
}


int
str_compare_new (void *a, void *b)
{
        printf ("\nI'm a new marshaller\n");
 
        return (str_compare (a, b));
}
 
